1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- "use client";
- import { userInfoApi } from "@/api/login";
- import { getUserMoneyApi, UserVipInfo } from "@/api/user";
- import { server } from "@/utils/client";
- import { useRequest } from "ahooks";
- import ItemCom from "./component/ItemCom";
- import ModalCom from "./component/ModalCom";
- import "./page.scss";
- import { ProfileHeader } from "./ProfileHeader";
- /**
- * @description 前台用户VIP信息 接口地址:https://app.apifox.com/link/project/4790544/apis/api-201160713
- */
- const getVipApi = async () => {
- return server
- .request<UserVipInfo>({
- url: "/v1/api/user/user_vip_info",
- method: "POST",
- })
- .then((res) => {
- if (res.code === 200) return res.data;
- });
- };
- const Profile = () => {
- const { data: userInfo } = useRequest<any, any>(userInfoApi, {
- pollingErrorRetryCount: 1,
- });
- const { data: userMoney } = useRequest<any, any>(getUserMoneyApi, {
- pollingErrorRetryCount: 1,
- pollingWhenHidden: false,
- });
- const { data: userVip } = useRequest<any, any>(getVipApi, {
- pollingErrorRetryCount: 1,
- });
- return (
- <div className="profile-box">
- <ProfileHeader
- userInfo={userInfo?.data}
- userMoney={userMoney?.data}
- userVip={userVip}
- />
- <ItemCom />
- <ModalCom />
- </div>
- );
- };
- export default Profile;
|